﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _0517病例系统
{
    public partial class xiugai : Form
    {
        public xiugai()
        {
            InitializeComponent();
        }

        
        private void button1_Click(object sender, EventArgs e)
        {
            frmdrug drug = new frmdrug();
            drug.Activate();


            

            string strsql = "";
            strsql = "update Yaopinss set 名称='" + textBox2.Text + "',厂家='" + textBox3.Text + "',单价='" + textBox4.Text + "',库存='" + textBox5.Text + "',生产日期='" + dateTimePicker1.Value.ToShortDateString() + "',过期日期='" + dateTimePicker2.Value.ToShortDateString() + "' where 编号='" + textBox1.Text + "'";
            DataAccess data = new DataAccess();
            data.dataCon();
            if (data.sqlExec(strsql))
            {
                MessageBox.Show("修改成功！");
                this.Hide();
                _0517.frmCer cer = new _0517.frmCer();
                cer.Activate();
            }
            else
            {
                MessageBox.Show("修改失败！");
            }
            
        }


        private void xiugai_Load_1(object sender, EventArgs e)
        {
            textBox1.Text = _0517病例系统.frmdrug.i;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            frmdrug drug = new frmdrug();
            drug.Activate();
        }
    }
}
